package com.lpwa.common.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
public class BasicConfig {
    private static String version;
    private static String name;
    private static String copyrightYear;
    private static String profile;
    private static String ipAddressEnabled;
//    =============================
    private static String websocketIp;
    private static String websocketPort;

    private static String tdmpLeApiIp;
    private static String tdmpLeApiPort;

    private static String onlineSocketIp;
    private static String onlineSocketPort;

    private static String tdgsApiIp;
    private static String tdgsApiPort;

    private static String coordinateSystemId;

    //websocketIP
    @Value("${basicConfig.websocketIp}")
    private String socketIp;
    //websocket 端口
    @Value("${server.port}")
    private String socketPort;
//    ===================tdmpLe接口配置==============================
    //tdmpLe接口 Ip
    @Value("${basicConfig.tdmpLeIp}")
    private String tdmpLeIp;
    //tdmpLe接口 端口
    @Value("${basicConfig.tdmpLePort}")
    private String tdmpLePort;
    //    ===================tdgs中间件接口配置==============================
    //tdmpLe接口 Ip
    @Value("${basicConfig.tdgsIp}")
    private String tdgsIp;
    //tdmpLe接口 端口
    @Value("${basicConfig.tdgsPort}")
    private String tdgsPort;
    //    ===================檀木项目属性配置==============================
    //版本
    @Value("${tanmu.version}")
    private String tanmuVersion;
    //版本年份
    @Value("${tanmu.copyrightYear}")
    private String tanmuCopyrightYear;
    //名称
    @Value("${tanmu.name}")
    private String tanmuName;
    //文件路径
    @Value("${tanmu.profile}")
    private String tanmuProfile;
//    获取ip地址开关
    @Value("${tanmu.addressEnabled}")
    private String addressEnabled;
    //tdmpLe接口 Ip
    @Value("${basicConfig.onlineWebsocketIp}")
    private String onlineWebsocketIp;
    //tdmpLe接口 端口
    @Value("${basicConfig.onlineWebsocketPort}")
    private String onlineWebsocketPort;

    @Value("${basicConfig.coordinateSystemIds}")
    private String coordinateSystemIds;
    @PostConstruct
    public void getTanmuVersion() {
        version = this.tanmuVersion;
    }

    public static String getVersion() {
        return version;
    }
    @PostConstruct
    public void getTanmuCopyrightYear() {
        copyrightYear = this.tanmuCopyrightYear;
    }

    public static String getCopyrightYear() {
        return copyrightYear;
    }

    @PostConstruct
    public void getSocketIp() {
        websocketIp = this.socketIp;
    }

    public static String getWebsocketIp() {
        return websocketIp;
    }
    @PostConstruct
    public void getSocketPort() {
        websocketPort = this.socketPort;
    }

    public static String getWebsocketPort() {
        return websocketPort;
    }

    @PostConstruct
    public void getTdmpLeIp() {
        tdmpLeApiIp = this.tdmpLeIp;
    }

    public static String getTdmpLeApiIp() {
        return tdmpLeApiIp;
    }

    @PostConstruct
    public void getTdmpLePort() {
        tdmpLeApiPort = this.tdmpLePort;
    }

    public static String getTdmpLeApiPort() {
        return tdmpLeApiPort;
    }

    @PostConstruct
    public void getTanmuName() {
        name = this.tanmuName;
    }

    public static String getName() {
        return name;
    }

    @PostConstruct
    public void getTanmuProfile() {
        profile = this.tanmuProfile;
    }

    public static String getProfile() {
        return profile;
    }

    @PostConstruct
    public void getAddressEnabled() {
        ipAddressEnabled = this.addressEnabled;
    }

    public static String getIpAddressEnabled() {
        return ipAddressEnabled;
    }


    @PostConstruct
    public void getOnlineWebsocketIp() {
        onlineSocketIp = this.onlineWebsocketIp;
    }

    public static String getOnlineSocketIp() {
        return onlineSocketIp;
    }

    @PostConstruct
    public void getOnlineWebsocketPort() {
        onlineSocketPort = this.onlineWebsocketPort;
    }

    public static String getOnlineSocketPort() {
        return onlineSocketPort;
    }

    @PostConstruct
    public void getTdgsIp() {
        tdgsApiIp = this.tdgsIp;
    }

    public static String getTdgsApiIp() {
        return tdgsApiIp;
    }

    @PostConstruct
    public void getTdgsPort() {
        tdgsApiPort = this.tdgsPort;
    }

    public static String getTdgsApiPort() {
        return tdgsApiPort;
    }

    @PostConstruct
    public void getCoordinateSystemIds() {
        coordinateSystemId = this.coordinateSystemIds;
    }

    public static String getCoordinateSystemId() {
        return coordinateSystemId;
    }
}
